<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"/>
    <title></title>
    <link rel="icon" href="favicon.ico" type="image/ico">
    <meta name="keywords" content="LightYear,,后台模板,后台管理系统,光年HTML模板">
    <meta name="description" content="LightYear是一个基于Bootstrap v3.3.7的后台管理系统的HTML模板。">
    <meta name="author" content="yinqi">
    <link href="/css/bootstrap.min.css" rel="stylesheet">
    <link href="/css/materialdesignicons.min.css" rel="stylesheet">
    <link href="/css/style.min.css" rel="stylesheet">
    <!--对话框-->
    <link rel="stylesheet" href="/js/jconfirm/jquery-confirm.min.css">
    <style>
        .input-with-icon {
            position: relative;
            padding-left: 20px;
            top: -5px;
            display: inline-block;
            vertical-align: middle;
            /* 确保这个div与其他行内元素垂直对齐 */
        }

        .input-with-icon input.btn-default {
            padding-left: 40px;
            /* 根据图标大小调整 */
        }

        .input-with-icon .icon {
            position: absolute;
            right: 5px;
            /* 根据需要调整 */
            top: 50%;
            transform: translateY(-50%);
            /* 垂直居中 */
            pointer-events: none;
            /* 防止点击图标时触发input的点击事件 */
        }

        /* 添加图标的链接样式 */

        .add-item {
            display: inline-block;
            margin-left: 10px;
            /* 与输入框保持间距 */
            text-decoration: none;
            /* 去除下划线 */
            color: #007bff;
            /* 假设链接颜色为蓝色 */
            /* 其他样式，如字体大小、鼠标悬停效果等 */
        }

        .add-item i {
            font-size: 1.5rem;
            /* 假设您想要图标稍大一些 */
            /* 其他图标样式 */
        }

        /* 根据需要添加其他样式 */

        td {
            vertical-align: middle;
        }
    </style>
</head>

<body>
<script src="/js/jquery.min.js" type="text/javascript"></script>
<div class="lyear-layout-web">
    <div class="lyear-layout-container">

        <!--导入头部信息-->
        <div id="header"></div>
        <script>$("#header").load("/header.html")</script>
        <!--导入左侧菜单栏-->
        <!--左侧导航-->
        <aside class="lyear-layout-sidebar">
            <!-- logo -->
            <div id="logo" class="sidebar-header">
                <a href="main.html"><img src="/images/logo-sidebar.png" title="LightYear" alt="LightYear"/></a>
            </div>
            <div class="lyear-layout-sidebar-scroll">
                <!--导入菜单栏-->
                <!--引入left-menu.html页面中的 th:fragment="leftMenu" 部分代码-->
                <div th:replace="/system/common/left :: leftMenu"></div>
                <div class="sidebar-footer">
                    <p class="copyright">Copyright &copy; 2019. <a target="_blank"
                                                                   href="http://lyear.itshubao.com">IT书包</a>
                        All rights reserved.</p>
                </div>
            </div>
        </aside>
        <!--页面主要内容-->
        <main class="lyear-layout-content">
            <div class="container-fluid">
                <div class="container d-flex flex-column">
                    <div class="row align-items-center justify-content-center min-vh-100">
                        <div class="col-md-6 col-lg-5 col-xl-5 py-6 py-md-0">
                            <div class="card shadow zindex-100 mb-0">
                                <div class="card-body px-md-5 py-5">
                                    <div class="mb-5">
                                        <h6 class="h3">公司注册</h6>
                                        <p class="text-muted mb-0">欢迎您使用工业管理系统</p>
                                    </div>
                                    <span class="clearfix"></span>
                                    <form id="register_from" method="post">
                                        <div class="form-group">
                                            <label class="form-control-label">公司名称</label>
                                            <div class="input-group">
                                                <div class="input-group-prepend">
                                                    <span class="input-group-text"><i data-feather="user"></i></span>
                                                </div>
                                                <input type="email" class="form-control" id="companyName" name="companyName" placeholder="公司名称">
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="form-control-label">电话号码</label>
                                            <div class="input-group">
                                                <div class="input-group-prepend">
                                                    <span class="input-group-text"><i data-feather="user"></i></span>
                                                </div>
                                                <input type="text" class="form-control" id="phone" name="phone" placeholder="电话号码" th:value="${session.phone}" readonly>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="form-control-label">地址</label>
                                            <div class="input-group">
                                                <div class="input-group-prepend">
                                                    <span class="input-group-text"><i data-feather="user"></i></span>
                                                </div>
                                                <input type="text" class="form-control" id="address" name="address" placeholder="地址">
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="form-control-label">法定代表人</label>
                                            <div class="input-group">
                                                <div class="input-group-prepend">
                                                    <span class="input-group-text"><i data-feather="user"></i></span>
                                                </div>
                                                <input type="text" class="form-control" id="legalMan" name="legalMan" placeholder="法定代表人" >
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="form-control-label">统一社会信用代码</label>
                                            <div class="input-group">
                                                <div class="input-group-prepend">
                                                    <span class="input-group-text"><i data-feather="user"></i></span>
                                                </div>
                                                <input type="text" class="form-control" id="socialCredit" name="socialCredit" placeholder="统一社会信用代码">
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="form-control-label">成立时间</label>
                                            <div class="input-group">
                                                <div class="input-group-prepend">
                                                    <span class="input-group-text"><i data-feather="user"></i></span>
                                                </div>
                                                <input type="date" class="form-control" id="makeTime" name="makeTime" placeholder="成立时间">
                                            </div>
                                        </div>
                                        <div class="mt-4">
                                            <button type="button" class="btn btn-block btn-primary" id="register_submit">注册</button></div>
                                    </form>
                                </div>
                                <div class="card-footer px-md-5"><small>Not registered?</small>
                                    <a href="#" class="small font-weight-bold">Create account</a></div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </main>
        <!--End 页面主要内容-->
    </div>
</div>
<div id="footer"></div>
<script>$("#footer").load("/footer.html")</script>

<script type="text/javascript" src="/js/perfect-scrollbar.min.js"></script>
<script type="text/javascript" src="/js/main.min.js"></script>
<script type="text/javascript">
    $("#register_submit").click(function (){
        var data = $("#register_from").serialize();
        $.ajax({
            url:'',
            type: 'POST',
            data:data,
            success:function (response){
                if (response.code === "0"){
                    alert("注册成功，返回登录页面")
                    window.location.href = '/system/company/list'
                }else {
                    alert(response.message)
                }
            },
            error:function(response){
                alert('网络错误!');
            }
        })
    })
</script>
</body>
</html>